
//
//  YJTabBar.m
//  07--第二题
//
//  Created by 冀永金 on 16/7/23.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "YJTabBar.h"
#import "UIView+Extension.h"

@interface YJTabBar ()
@property (nonatomic,strong) UIButton *button;
@end

@implementation YJTabBar
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
    }
    return self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
//    self.button.centerX = self.frame.size.width * 0.5;
//    self.button.centerY = self.frame.size.height * 0.5;
    CGFloat tabBarButtonw = self.frame.size.width / 5;
    CGFloat tabBarButtonIndex = 0;
    for (UIView *child in self.subviews) {
        if ([child isKindOfClass:NSClassFromString(@"UITabBarButton")]) {
            // 设置x
            child.x = tabBarButtonw * tabBarButtonIndex;
            // 设置宽度
            child.width = tabBarButtonw;
            tabBarButtonIndex ++;
                        
        }
    }
    
    
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
